import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import  ElementPlus from 'element-plus';
import 'element-plus/theme-chalk/index.css';
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import Cookies from "js-cookie";
createApp(App).use(store).use(router).use(ElementPlus, { size: 'default', zIndex: 3000,  locale: zhCn, }).mount('#app')
// 前置守卫
router.beforeEach((to,from,next)=>{
        if (Cookies.get("token") != null || to.path=="/login") {
            next()
        } else {
            next({path:"/login",query:{ind:to.path}})
        }
})
